/*
 * Copyright Owen Watson 2009
 * 
 * This file is part of ArtNotes.
 *
 * ArtNotes is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * ArtNotes is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with ArtNotes.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.CoreGraphics;
using System.Drawing;

namespace ArtNotes
{


	public class testview : UIViewController
	{

		private UIButton RoundedButtonType (float xpos, float ypos, string btitle)
		{
			var button = UIButton.FromType (UIButtonType.RoundedRect);
			button.Frame = new RectangleF (xpos, ypos, 106f, 40f);
			button.BackgroundColor = UIColor.Clear;
			button.SetTitle (btitle, UIControlState.Normal);
			button.SetTitleColor (UIColor.Black, UIControlState.Normal);

			button.Tag = 1;
			// To support reusable cells
			return button;
		}
		
		public testview ()
		{
		}
		
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			UIButton button1 = RoundedButtonType (100f, 50f, "View 1");
			ANNotebookController anc = new ANNotebookController ();
			button1.TouchDown += delegate {
			    Console.WriteLine("Button 1 / View 1");
				this.NavigationController.PushViewController(anc,true);
			};
			View.AddSubview(button1);
			NavigationItem.BackBarButtonItem = new UIBarButtonItem () { Title = "Back" };
			this.TabBarItem.Image = UIImage.FromFileUncached("/Library/fatcat.jpg");
			this.NavigationController.NavigationBar.TintColor = UIColor.Red;
		}

	}
}